<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="name">
    </div>
</body>
<script>
    const app = new Vue({
        el: '#app',
        data:{
            name:'张三'
        },
        watch:{
            name(newValue){
                var len = newValue.length;
                console.log(newValue);
                if(len%2==0){
                    console.log('长度为偶数');
                }
            }
        }
    })
</script>
</html>